
public class program {
    public static void main(String[] args) {
        double e = 1.0;
        double item = 1.0;
        for (int i = 1; i <= 100000; i++) {
            item /= i;
            e += item;

            if (i % 10000 == 0) {
                System.out.println("当 i = " + i + " 时，e ≈ " + e);
            }
        }
    }
}
//当i=170时，达到极限